package com.admin.education.models;

import com.admin.education.repositories.Identifiable;
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.Set;

@Entity
@Table(name = "comments")
@EntityListeners(AuditingEntityListener.class)
@Data
public class Comments  implements Serializable,Identifiable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="id")
    private long id;
    @Column(name="user_information_id")
    @NotNull
    private long userInformationId;
    @Column(name="create_time")
    private Date createTime;
    @Column(name="content")
    private String content;
    @OneToOne(cascade = CascadeType.DETACH)
    private Circles circles;
}
